import time

import requests

# Body = {'id': '32d03f96c5ebf82fc3c6f4e2b6b74bb6',
#         'objType': 'person',
#         'minLength':'2'}

Headers = {
    'Cookie':'DataAcquisition-sid=s%3A81pFBwdSda4v7ll5753239K6UcxTTVsC.cxlaGsKFM1TgOpLBc%2FEgBHpvaVS04Ksu7CMihoZT6wk'
}

id="32d03f96c5ebf82fc3c6f4e2b6b74bb6"
objType="person"
minLength=2

response = requests.get(url = "http://172.16.60.12/common/sightWords?id={}&objType={}&minLength={}".format(id, objType, minLength), headers=Headers)
data = response.json()

lens = len(data)

"""通联类型为 全部 的词云"""

l = []
dic = {}

for i in range(0, lens):
    l.append(data[i]["key"])
    dic[data[i]["key"]] = data[i]["doc_count"]
print(l)


response1 = requests.get(url = "http://172.16.60.12/common/sightWords?id=32d03f96c5ebf82fc3c6f4e2b6b74bb6&objType=person&minLength=2&type=mobile", headers=Headers)
data1 = response1.json()

lens1 = len(data1)

"""通联类型为 手机  的词云"""

l1 = []
dic1 = {}
for i in range(0, lens1):
    l1.append(data1[i]["key"])
    dic1[data[i]["key"]] = data1[i]["doc_count"]

print(l1)

l = set(l)

l1 = set(l1)

common = list(l&l1)

for i in range(0, len(common)):
    print(common[i], dic[common[i]])
    print(common[i], dic1[common[i]])



